package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Strategy;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface StrategyMapper {

    int insert(Strategy record);

    Strategy selectByPrimaryKey(Long id);

    List<Strategy> queryForList(QueryObject qo);

    int updateByPrimaryKey(Strategy record);

    List<Map> listAll();

    List<Strategy> listAllByState(QueryObject qo);

    Integer selectPraiseNums(@Param("strategyId") Long strategyId, @Param("state") Integer state);

    void insertRelations(@Param("userId") Long userId, @Param("strategyId") Long strategyId, @Param("state") Integer state);

    String selectRelation(@Param("userId") Long userId, @Param("strategyId") Long strategyId, @Param("state") Integer state);

    void deleteRelation(@Param("strategyId") Long strategyId, @Param("userId") Long userId, @Param("state") Integer state);

}